/*
package boss.portal.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericToStringSerializer;
import redis.clients.jedis.JedisPoolConfig;

*/
/**
 * @FileName: RedisConfig
 * @Author: zyh
 * @Date: 2021/3/25  11:00:00 17:07
 * @Description: Redis配置类
 *//*

@Configuration
//@ComponentScan("boss.portal.config")
public class RedisConfig {

    @Bean
    public JedisPoolConfig jedisPoolConfig() {
        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
        jedisPoolConfig.setMaxIdle(10);
        jedisPoolConfig.setMaxTotal(10);
        return jedisPoolConfig;
    }

    @Bean
    public JedisConnectionFactory jedisConnectionFactory() {
        JedisConnectionFactory jedisConFactory = new JedisConnectionFactory();
        jedisConFactory.setHostName("zyhredis.redis.cache.chinacloudapi.cn");
        jedisConFactory.setPort(6380);
        // 这里我本地的Reids没有设置密码，暂时注释掉，如果有密码，请放开下面的注释
        jedisConFactory.setPassword("snbFmg+5hlMYrdk5VNZn+Bu0eZzaWqNREgi+R6LVCZ0=");
        jedisConFactory.setPoolConfig(jedisPoolConfig());
        jedisConFactory.setDatabase(7);
        return jedisConFactory;
    }

    @Bean
    public RedisTemplate<String, Object> redisTemplate() {
        final RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();
        template.setConnectionFactory(jedisConnectionFactory());
        template.setValueSerializer(new GenericToStringSerializer<Object>(Object.class));
        return template;
    }

    public static void main(String[] args) {
        RedisConfig redisConfig = new RedisConfig();
        System.out.println(redisConfig.jedisConnectionFactory().getConnection());
    }
}
*/
